package com.liyi.letter.system.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * @program: letter_parent
 * @description
 * @author: tianwen
 * @create: 2023-06-06 10:15
 **/
@Data
public class BaseEntity implements Serializable {
    /**
     *
     */
    @TableId(value = "id",type = IdType.AUTO)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;
    /**
     *
     */
    @TableField(value = "created_time",fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yy-MM-dd HH:mm:ss")
    private Date createdTime;

    /**
     *
     */
    @TableField(value = "updated_time",fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yy-MM-dd HH:mm:ss")
    private Date updatedTime;

    /**
     *
     */
    @TableField(value = "is_deleted")
    @JsonIgnore
    @TableLogic
    private Integer isDeleted;

}
